/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

.chat-terminal-content-part {
	flex: 1 1 auto;
	min-width: 0;
}

.chat-terminal-content-part .chat-terminal-content-title {
	border: 1px solid var(--vscode-chat-requestBorder);
	border-radius: 4px;
	padding: 5px 9px;
	max-width: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;

	.rendered-markdown {
		display: flex;
		column-gap: 4px;

		p {
			margin: 0 !important;
		}

		.monaco-tokenized-source {
			background: transparent !important;
		}
	}
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block > .rendered-markdown {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	column-gap: 4px;
	align-items: center;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block > .rendered-markdown p {
	display: inline-flex;
	align-items: center;
	column-gap: 4px;
	margin: 0 !important;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block > .rendered-markdown .monaco-tokenized-source {
	background: transparent !important;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block > .rendered-markdown code {
	font-size: var(--vscode-chat-font-size-body-xs);
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration.success,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration.success {
	color: var(--vscode-terminalCommandDecoration-successBackground) !important;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration.default-color,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration.default-color {
	color: var(--vscode-terminalCommandDecoration-defaultBackground) !important;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration.error,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration.error {
	color: var(--vscode-terminalCommandDecoration-errorBackground) !important;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration.default,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration.default {
	pointer-events: none;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration:not(.default):hover,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration:not(.default):hover {
	cursor: pointer;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration:focus-visible,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration:focus-visible {
	outline: 1px solid var(--vscode-focusBorder);
	outline-offset: 2px;
}

.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .chat-terminal-command-decoration:not(.default):hover::before,
.chat-terminal-content-part .chat-terminal-content-title .chat-terminal-command-block .terminal-command-decoration:not(.default):hover::before {
	border-radius: 5px;
	background-color: var(--vscode-toolbar-hoverBackground);
}

.chat-terminal-content-part .chat-terminal-action-bar {
	display: flex;
	gap: 4px;
	margin-left: auto;
	align-self: flex-start;
}

.chat-terminal-content-part .chat-terminal-content-message {
	.rendered-markdown {
		white-space: normal;
		line-height: normal;

		& > p {
			color: var(--vscode-descriptionForeground);
			font-size: var(--vscode-chat-font-size-body-s);
			margin: 0 !important;

			code {
				font-size: var(--vscode-chat-font-size-body-xs);
			}
		}
	}
}

.chat-terminal-output-container.collapsed { display: none; }
.chat-terminal-output-container {
	border: 1px solid var(--vscode-chat-requestBorder);
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	background: var(--vscode-panel-background);
	max-height: 300px;
	box-sizing: border-box;
	overflow: hidden;
	position: relative;
	max-width: 100%;
	padding: 5px 9px;
}

.chat-terminal-content-title.expanded {
	border-bottom-left-radius: 0px;
	border-bottom-right-radius: 0px;
	border-bottom: 0;
}

.chat-terminal-output-container.expanded { display: block; }
.chat-terminal-output-container > .monaco-scrollable-element {
	width: 100%;
}
.chat-terminal-output-body {
	padding: 4px 6px;
	max-width: 100%;
	height: 100%;
	box-sizing: border-box;
}
.chat-terminal-output-content {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.chat-terminal-output {
	margin: 0;
	white-space: pre;
	font-size: 12px;
}

.chat-terminal-output-empty {
	font-style: italic;
	color: var(--vscode-descriptionForeground);
	line-height: normal;
}

.chat-terminal-output div,
.chat-terminal-output span {
	height: auto;
	line-height: normal;
}

.chat-terminal-output pre {
	margin: 0;
}
.chat-terminal-output-info {
	color: var(--vscode-descriptionForeground);
	font-size: var(--vscode-chat-font-size-body-xs);
}
